/**
 * @date 3:09:15 PM
 * EducationSMSController.java
 * Administrator
 * TODO
 */
package com.qs.education.controller;

import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.qs.education.bean.api.ResponseBean;
import com.qs.education.bean.beans.EducationSMSResponse;
import com.qs.education.service.ISMSAPPService;
/**
 * @class EducationSMSController	
 * @author Warren
 * @description
 * @date Nov 5, 2018 
 */
@RestController
public class EducationSMSController {
	
	@Autowired
	private ISMSAPPService smsAPPService;
	private final Logger log = Logger.getLogger(this.getClass());
	
	/**
	 * @author Warren
	 * @param mobile
	 * @param sendType
	 * @param request
	 * @return Map<String,Object>
	 * @description 获取验证码
	 * @date Nov 6, 2018
	 */
	@RequestMapping("/sms/getSMS")
	public Map<String, Object> getSMS(String mobile,int sendType,HttpServletRequest request) {
		log.info("api");
		EducationSMSResponse educationSMSResponse = smsAPPService.getSMS(mobile, sendType, request);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("educationSMSResponse", educationSMSResponse);
		return map;
	}
	
	/**
	 * @author Warren
	 * @param mobile
	 * @param code
	 * @return Map<String,Object>
	 * @description 校验验证码
	 * @date Nov 6, 2018
	 */
	@RequestMapping("/sms/checkSMS")
	public Map<String, Object> checkSMS(String mobile,String code) {
		log.info("api");
		ResponseBean responseBean = smsAPPService.checkSMS(mobile,code);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("responseBean", responseBean);
		return map;
	}
}
